package com.project.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDate;

/**
 * @Author(王思翰)
 * @Description(类的描述)商品实体类
 * @Date(创建时间) 2021/7/31 13:42
 */
public class ProductBean {
    /**
     * 商品id
     */
    private int id;
    /**
     * 商品名字
     */
    private String name;
    /**
     * 商品单价
     */
    private int money;
    /**
     * 生产日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate date;
    /**
     * 商品照片
     */
    private String img;
    /**
     * 产地
     */
    private String area;
    /**
     * 已购数量
     */
    private int number;

    public ProductBean() {
    }

    public ProductBean(int id) {
        this.id = id;
    }

    public ProductBean(String name, int money, String img, String area, int number) {
        this.name = name;
        this.money = money;
        this.img = img;
        this.area = area;
        this.number = number;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    @Override
    public String toString() {
        return "ProductBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", money=" + money +
                ", date=" + date +
                ", img='" + img + '\'' +
                ", area='" + area + '\'' +
                ", number=" + number +
                "}\n";
    }
}
